package com.yxuan.springboot.service.impl;

import com.yxuan.springboot.mapper.TestScorneirongMapper;
import com.yxuan.springboot.model.TestScorneirong;
import com.yxuan.springboot.service.TestScorneirongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;

/**
 * 
 * @author zchao
 *    TestScorneirong业务层实现类
 * @date 2023-05-16 14:22:56
 */
@Service
@Transactional
public class TestScorneirongServiceImpl extends BaseServiceImpl<TestScorneirong> implements TestScorneirongService {

    @Autowired
    private TestScorneirongMapper testScorneirongMapper;

    @Override
    public HashMap<String, Object> addScore(TestScorneirong entity) throws Exception {
        HashMap<String, Object> result = new HashMap<>();
        Date date = new Date();
        Timestamp timestamp = new Timestamp(date.getTime());
        entity.setCreateTime(timestamp);
        entity.setUpdateTime(timestamp);
        testScorneirongMapper.insert(entity);
        result.put("add","success");
        return result;
    }
}
